#ifndef RPCPROVIDER_HPP
#define RPCPROVIDER_HPP

#include </usr/local/include/muduo/net/EventLoop.h>
#include </usr/local/include/muduo/net/InetAddress.h>
#include </usr/local/include/muduo/net/TcpConnection.h>
#include </usr/local/include/muduo/net/TcpServer.h>
#include "../example/rpc.pb.h"

//RpcProvider的构造函数比较重要，因为他是Rpc业务的提供者，需要接受各种类型
class RpcProvider
{
public:
    bool NotifyService(::google::protobuf::Service* serivce);

    //启动Rpc服务
    void start();

    void OnConnection(const muduo::net::TcpConnectionPtr&);

    void OnMessage(const muduo::net::TcpConnectionPtr&,
                            muduo::net::Buffer*,
                            muduo::Timestamp);
private:
    muduo::net::EventLoop _eventloop;
};


#endif